#!/usr/bin/python3
# coding=utf-8
import sys
import json


def command_result(raw):
    postprocess_result = {
        "code": 0,
        "err_msg": "",
        "result": {}
    }
    postprocess_result["result"] = {
        "CommandResult": {"data": [{"key": "", "value": raw}]}
    }
    print(json.dumps(postprocess_result, indent=4))


def extract_params():
    path, res, task_id = sys.argv[1], "", sys.argv[2]
    with open(path, 'r') as tmp:
        for line in tmp.readlines():
            res = res + "\r" + line
    return res, task_id


if __name__ == "__main__":
    res, _ = extract_params()
    command_result(res)
